Construction of Eecient Generalized Lr Parsers
نویسندگان
چکیده
We show how LR parsers for the analysis of arbitrary context-free grammars can be derived from classical Earley's parsing algorithm. The result is a Generalized LR parsing algorithm working at complexity O(n 3) in the worst case, which is achieved by the use of dynamic programming to represent the non-deterministic evolution of the stack instead of graph-structured stack representations, as has often been the case in previous approaches. The algorithm behaves better in practical cases, achieving linear complexity on LR grammars. Experimental results show the performance of our proposal.
منابع مشابه
A Case Study in Functional Programming: Generating Eecient Functional Lr(1) Parsers
This paper presents a case study in functional programming. The paper is based upon a chapter of the course notes of a grammars and parsing course which the authors have given to undergraduate students. The chapter presents a functional program that generates eecient functional LR(1) parsers.
متن کاملConstruction of E cient Generalized LR Parsers
We show how LR parsers for the analysis of arbitrary context-free grammars can be derived from classical Earley's parsing algorithm. The result is a Generalized LR parsing algorithm working at complexity O(n 3) in the worst case, which is achieved by the use of dynamic programming to represent the non-deterministic evolution of the stack instead of graph-structured stack representations, as has...
متن کاملConstruction of Efficient Generalized LR Parsers
We show how LR parsers for the analysis of arbitrary contextfree grammars can be derived from classical Earley’s parsing algorithm. The result is a Generalized LR parsing algorithm working at complexity O(n) in the worst case, which is achieved by the use of dynamic programming to represent the non-deterministic evolution of the stack instead of graph-structured stack representations, as has of...
متن کاملVisual Language Editors Based on Lr Parsing Techniques
Visual language editors should provide a user-friendly environment where users are supported in an effective way in the construction of visual sentences. In this paper, we propose an approach for the construction of syntax-directed visual language editors by integrating incremental parsers into freehand editors. The approach combines the LR-based techniques for parsing visual languages with the...
متن کاملControlled Grammatic
A new approach to ambiguity of context-free grammars is presented, and within this approach the LL and LR techniques are generalized to solve the following problems for large classes of ambiguous grammars: |Construction of a parser that accepts all sentences generated by the grammar, and which always terminates in linear time. |Identiication of the structural ambiguity: a nite set of pairs of p...
متن کامل